﻿using System;
using System.Collections;
using System.Text;

namespace Petra.Gis.Geometry.Image.Tiff
{
  public partial class ImageFileDirectory
  {

    internal void checkTileOffsets(Tag tag)
    {
      if (tag.Count < 1)
      {
        throw new InvalidFileStructureException("Need at least one tile offset for tiled image.");
      }
      if (tag.Count == 1)
      {
        if (!tag.isInt())
        {
          throw new InvalidFileStructureException("There is " +
            "only one tile offset, but its type is not integer.");
        }
      }
    }



    internal void checkTileHeight(Tag tag)
    {
      if (tag.Count != 1 || !tag.isInt())
      {
        throw new InvalidFileStructureException("Expected " +
          "single byte/short/long value for image height " +
          "(count=" + tag.Count + ", type=" + tag.Type + ").");
      }
    }




    internal void checkTileWidth(Tag tag)
    {
      if (tag.Count != 1 || !tag.isInt())
      {
        throw new InvalidFileStructureException("Expected " +
          "single byte/short/long value for image height " +
          "(count=" + tag.Count + ", type=" + tag.Type + ").");
      }
    }
  }
}
